package main;

import java.rmi.RemoteException;

import javax.swing.JOptionPane;

import servicioWeb.Beanlogin;
import Servlet.service.ImplLogin;
import Servlet.service.ImplLoginProxy;

public class MAIN {

	public static void main(String[] args) {
		ImplLogin iface = new ImplLoginProxy(
				"http://localhost:8080/validaCredencialesServlet/services/ImplLogin");
		Beanlogin obj = new Beanlogin();
		obj.setUsuario(JOptionPane.showInputDialog("Usuario"));
		obj.setPassword(JOptionPane.showInputDialog("Password"));
		try {
			obj = iface.validaLogin(obj);
			if(obj.getStatus()){
				System.out.println("welcome!");
			}else{
				System.out.println(obj.getMensaje());
			}
		} catch (RemoteException e) {
			e.printStackTrace();
		}

	}
}
